/**
 * Copyright (c) 2016-2019 人人开源 All rights reserved.
 *
 * https://www.raip.io
 *
 * 版权所有，侵权必究！
 */

package com.cz.modules.job.task;
import com.cz.modules.jxc.service.JxcSaleOrderService;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Calendar;
/**
 * @author Mark sunlightcs@gmail.com
 */
@Component("sellMasterTask")
public class SellMasterTask implements ITask {
	private Logger logger = LoggerFactory.getLogger(getClass());

	@Autowired
	public JxcSaleOrderService saleOrderService;
	@Override
	public void run(String params){
		Calendar c = Calendar.getInstance();
		c.add(Calendar.MINUTE, -Integer.parseInt(params));// 5分钟之前的时间
		String beginTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(c.getTime());  // 前
		System.err.println("开始时间------------"+beginTime);
		try {
			saleOrderService.getSellMasterByCode(beginTime);
		}catch (Exception e){
			e.printStackTrace();
		}
	}
}
